//    Copyright (C) Kherty.  All rights reserved.
using OpenLS.Core.Serialization;

namespace OpenLS.Drawing
{
    internal class BaseStyles : IOfficeXmlSerializable
    {
        private FormatScheme _fmtScheme;
        private ColorScheme colorScheme;

        private FontScheme fontScheme;

        public ColorScheme ColorScheme
        {
            get { return colorScheme; }
            set { colorScheme = value; }
        }

        public FontScheme FontScheme
        {
            get { return fontScheme; }
            set { fontScheme = value; }
        }

        public FormatScheme FormatScheme
        {
            get { return _fmtScheme; }
            set { _fmtScheme = value; }
        }

        #region IOfficeXmlSerializable Members

        void IOfficeXmlSerializable.ReadXml(ReadContext context)
        {
            using (var c = context.Read("themeElements"))
            {
                c.PassAttributes();
                ColorScheme = c.ReadElement<ColorScheme>();
                FontScheme = c.ReadElement<FontScheme>();
                FormatScheme = c.ReadElement<FormatScheme>();
            }
        }

        void IOfficeXmlSerializable.WriteXml(WriteContext context)
        {
            using (WriteContext c = context.Write("themeElements"))
            {
                c.WriteElement(ColorScheme);
                c.WriteElement(FontScheme);
                c.WriteElement(FormatScheme);
            }
        }

        #endregion
    }
}